diff options
Diffstat (limited to 'examples/with-content/src/pages/blog/[...slug].astro')
-rw-r--r-- | examples/with-content/src/pages/blog/[...slug].astro | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/examples/with-content/src/pages/blog/[...slug].astro b/examples/with-content/src/pages/blog/[...slug].astro deleted file mode 100644 index 0d656a153..000000000 --- a/examples/with-content/src/pages/blog/[...slug].astro +++ /dev/null @@ -1,21 +0,0 @@ ---- -import { CollectionEntry, getCollection } from 'astro:content'; -import BlogPost from '../../layouts/BlogPost.astro'; - -export async function getStaticPaths() { - const posts = await getCollection('blog'); - return posts.map((post) => ({ - params: { slug: post.slug }, - props: post, - })); -} -type Props = CollectionEntry<'blog'>; - -const post = Astro.props; -const { Content } = await post.render(); ---- - -<BlogPost {...post.data}> - <h1>{post.data.title}</h1> - <Content /> -</BlogPost> |